import { createRouter, createWebHashHistory } from 'vue-router'

import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Play from '@/views/playground'
import Category from '@/views/Category'
import SubCategory from '@/views/Category/Sub'
import Goods from '@/views/Goods'
const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }

  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        component: Home
      },
      {
        path: 'category/:id',
        component: Category
      },

      {
        path: 'subCategory/:id',
        component: SubCategory
      },
      {
        path: '/goods/:id',
        component: Goods
      }

    ]
  },
  {
    path: '/play',
    component: Play
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
